package com.linkstec.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.linkstec.service.WebSocketServiceImpl;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Controller
@RequestMapping("/api/test")
@Tag(name = "服务器向客户端推送消息接口")
public class WebSocketController {

    @Autowired
    private WebSocketServiceImpl webSocketServiceImpl;
    /**
     * 启动页面
     * @return
     */
    @GetMapping("/start")
    public String start(){
        return "index";
    }

    @PostMapping("/pushToWeb")
    @Operation( summary = "服务器端向客户端推送消息", description = "服务器端向客户端推送消息")
    public String pushToWeb(){

    	webSocketServiceImpl.printTime();
        return "aaaa";
    }

}